{% extends "base_generic.html" %}

{% block title %}VizSpread - Map{% endblock %}

{% block javascript %}
<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAT3TWfMATChtqQlhy3rBImRSsHxnIok2KLD68NIgI81Lh7Wi2ThTe_2srKomD6r2DUDpVToggp3OBmQ&amp;sensor=false"></script>
<!--
<script type="text/javascript" src="http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/release/src/markermanager.js">
<script type="text/javascript" src="javascript/jquery-1.3.2.min.js"></script>
-->
<script type="text/javascript" src="javascript/vizmapper.js"></script>
<script type="text/javascript">
//<![CDATA[

var vmap;
var geodata;

function loadVMap(){
	if (GBrowserIsCompatible()) {
		if (geodata) {
			vmap = new VMapper("map");
			vmap.map.addControl(new GLargeMapControl());
			vmap.loadMapCentre("mapcentre-location");
			vmap.showCentre();
			vmap.loadMapData(geodata);
			vmap.setUpMarkers();
		}
	}
}
//]]>
</script>
{{ locations }}
{% endblock javascript %}

{% block header %}
	{{ header }}
{% endblock header %}

{% block bodytag %}<body onload="loadVMap()" onunload="GUnload()">{% endblock bodytag %}
{% block content %}

	<div id="map"></div>
	{% if geocodeerrors %}
	<div id="geocodeerrors">
		<h2>Geocode Errors</h2>
		<div>{{ geocodeerrors }}</div>
	</div>
	{% endif %}
	<div id="mapcentre">
		<h2>Map centre</h2>
		<p id="mapcentre-location">{{ mapcentre }}</p>
	</div>
	<div id="mapcentre">
		<h2>Data</h2>
		{{ contacts }}
	</div>	
{% endblock content %}
